package cn.ulyer.core.secure.authority.strategy;

import cn.ulyer.common.constants.AuthStrategyEnum;
import cn.ulyer.common.security.authority.AuthorityHandlerStrategy;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;

import javax.servlet.http.HttpServletRequest;

public class NoAuthHandlerStrategy implements AuthorityHandlerStrategy {

    @Override
    public boolean handler(HttpServletRequest request, Authentication authentication, GrantedAuthority grantedAuthority) throws AccessDeniedException {
        return true;
    }

    @Override
    public String strategy() {
        return AuthStrategyEnum.NO_AUTH.name();
    }


}
